    variables = who('A*');
    
maxS = 100;
for s=1:maxS
    
    highestValue = 0;
    for i=1:size(variables)
        
        hist = eval([char(variables(i))]);
        x = hist(:,1);
        ind = find(x==s);
        if(length(ind)~=0 && hist(ind,2)>highestValue)
            pMaximizing(s) = probabilities(i);
            highestValue = hist(ind,2);
        end 
    end
end
s=[1:maxS];